package com.example.demo.common.validator.annotation;


import com.example.demo.common.validator.IdCardValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author zhaiding
 * @since 2019-09-06
 */
@Constraint(validatedBy = {IdCardValidator.class})
@Documented
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
public @interface IdCard {

    /**
     * 错误提示信息
     */
    String message() default "身份证校验失败";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
